<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>计算器</title>
	</head>
	<body>
		<p>数字1：</p>
		<input id="n1" type="text" />
		<p>数字2：</p>
		<input id="n2" type="text" />
		<br />
		<br />
		<input id="sum" type="button" value="求和" onclick="add()"/>
		<p id="sum"></p>
		<script>
			function add(){
				var num1=document.getElementById('n1');
				var num2=document.getElementById('n2');
				var sum=document.getElementById('sum');
				var result=num1.value+num2.value;
	</body>
</html>
